package com.gxa.core.recycling.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author ：looker
 * @date ：Created in 2021/11/29 11:20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "user")
@Entity   //orm对象关系映射
public class User implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;
    @Column(name = "name")
    private String name;
    @Column(name = "phone")
    private String phone;
    @JsonIgnore
    @Column(name = "pwd")
    private String pwd;
    @Column(name = "sex")
    private String sex;
    @Column(name="nickName")
    private String nickName;

    //会员级别
    @Column(name="levelId")
    private String levelId;

    //省市
    @Column(name="provinces")
    private String provinces;

    //所属小区id
    @Column(name = "quartersId")
    private Long quartersId;

    //详细地址
    @Column(name = "location")
    private String location;

    //用户性质
    @Column(name = "type")
    private String type;

    //头像
    @Column(name = "img")
    @JsonFormat(pattern = "\\\\n")
    private String img;

    //现有积分
    @Column(name = "nowPoints")
    private Integer nowPoints;

    //最近登录时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "lastLogin")
    private Date lastLogin;

    @Column(name = "wechat")
    private String wechat;

    //总积分
    @Column(name = "allPoints")
    private Integer allPoints;


    //已经连续签到天数
    @Column(name = "days")
    private Integer days;

    @Column(name = "token")
    private String token;
    //用户签到状态,0为未签到，1为已签到
    @Column(name = "state")
    private Boolean state;
}
